﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectFileEdit2.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Attach.ProjectFileEdit2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <link rel="stylesheet" type="text/css" href="../../Styles/control.css" />
    <script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.4.1.js"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/control.js"></script>
    <script language="javascript" type="text/javascript" src="../../Uploadify/js/jquery.min.js"></script>
    <link rel="Stylesheet" href="../../Uploadify/js/uploadify.css" />
    <script language="javascript" type="text/javascript" src="../../Uploadify/js/swfobject.js"></script> 
    <script language="javascript" type="text/javascript" src="../../Uploadify/js/jquery.uploadify.min.js"></script>
    <style type="text/css">
        div
        {
            font-size:12px;font-weight:700;
        }
    </style>
    <script language="javascript" type="text/javascript">
        //展开收起操作
        function change(objID) {
            if (document.all("tb_" + objID).style.display == "block") {
                document.all("img_" + objID).src = "../../images/ico_have2.gif";
                document.all("img_" + objID).alt = "展开";
                document.all("tb_" + objID).style.display = "none"
            }
            else {
                document.all("img_" + objID).src = "../../images/ico_nohave2.gif";
                document.all("img_" + objID).alt = "收起";
                document.all("tb_" + objID).style.display = "block"
            }
        }
    </script>
    <script type="text/javascript">
        <%if (PageSecurity.Add)
                  { %>
        $(document).ready(function () {
            $("#uploadify").uploadify({
                'uploader': '../../Uploadify/js/uploadify.swf',
                'script': 'Json/UploadProjectDocument.ashx?DataID=<%=Request["ID"] %>|<%=((int)Honestysoft.Financing.Model.EnumItem.AttachmentBuType.ProjectDocument).ToString() %>',
                'cancelImg': '../../Uploadify/js/cancel.png',
                'folder': '',
                'wmode': 'transparent',
                'queueID': 'fileQueue',
                'auto': true,
                'multi': true,
                'width': 62,
                'height': 20,
                'buttonImg': '../../Uploadify/images/addAtt4.png',
                'onComplete': function (event, queueID, fileObj, response, data) {

                },
                'onAllComplete': function (event, data) {
                    document.getElementById("<%=btnRebind.ClientID %>").click();
                },
                'onSelect': function (e, queueId, fileObj) {
                }
            });
        });
        <%} %>
</script> 
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align:center;margin-top:4px">
       项目档案管理
    </div>    
    <div>
         <img id="img_1" alt="收起" onclick="change('1')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
         <span style="vertical-align:middle;cursor:hand" onclick="change('1')">一、项目基本情况</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" width="100%"  id="tb_1" style="display: block;" >
		<tr>
			<td class="title1" width="80px" style="text-align:left" >项目名称</td>
			<td><asp:Label runat="server" ID="lblProjectName"></asp:Label></td>
			<td  class="title1" width="80px" style="text-align:left" >项目编号</td>
			<td><asp:Label runat="server" ID="lblProjectSN"></asp:Label></td>
		</tr>
		<tr>
			<td class="title1"  style="text-align:left" >项目单位</td>
			<td><asp:Label runat="server" ID="lblOwner971"></asp:Label></td>
			<td class="title1"  style="text-align:left" >建设单位</td>
			<td><asp:Label runat="server" ID="lblOwner"></asp:Label></td>
		</tr>
    </table>
    <div>
        <img id="img_2" alt="收起" onclick="change('2')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('2')">二、项目档案列表</span>
    </div> 
    <div>
        <table width="100%">
            <tr>
                <td>&nbsp;</td><td width="62px">
                <%if (PageSecurity.Add)
                  { %>
                <input type="file" name="uploadify" id="uploadify" />
                <%} %></td>
                <td width="62px"><asp:Button ID="btnDelete" runat="server" Text="删除" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" 
                        OnClientClick="javascript:var ret=getNoSelectionAlert('chkID','请选择要删除的记录后再执行此操作！');if(ret){return confirm('确定要删除所选的记录吗?')}else{return false;}" onclick="btnDelete_Click"  /></td>
            </tr>
        </table>
        <div id="fileQueue"></div>
    </div>   

    <table cellpadding="0" cellspacing="0" border="1" class="tEdit"   id="tb_2" style="display: block;font-family:宋体;font-size:12px" >
        <thead>
            <th align="center" width="30px">
                <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:checkAll(this,"chkID")' />
            </th>
           <th style="width:32px">图标</th>
           <th>文件名(点击可打开或下载文件)</th>
           <th style="width:50px">类型</th>
           <th style="width:80px">大小</th>
        </thead>
        <asp:Repeater runat="server" ID="rptList">
            <ItemTemplate>
            <tr>
                <td align="center" >
					<input type="checkbox" name="chkID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
				</td>
                <td style="text-align:center"><%#GetIcon( DataBinder.Eval(Container.DataItem,"Extension")+"") %></td>
                <td style="text-align:left"><%# GetTextUrl(DataBinder.Eval(Container.DataItem, "FileName") + "", DataBinder.Eval(Container.DataItem, "Extension") + "", DataBinder.Eval(Container.DataItem, "Path") + "")%></td>
                <td style="text-align:center"><%#  DataBinder.Eval(Container.DataItem,"Extension") %></td>
                <td style="text-align:center"><%# DataBinder.Eval(Container.DataItem, "Size") + "" == "0" ? "" : Honestysoft.BaseLibrary.Common.StringHelper.FormatFileSize(Convert.ToInt64( DataBinder.Eval(Container.DataItem, "Size")))%></td>
               
            </tr>
            </ItemTemplate>
        </asp:Repeater>
   </table>
   <div class="paging_area">
     <frameworkwebcontrols:aspnetpager id="AspNetPager1" runat="server"
                    alwaysshow="true" firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" pageindexboxtype="DropDownList"
                    prevpagetext="上一页" showpageindex="true" showcustominfosection="Right" submitbuttontext="Go"
                    textafterpageindexbox="页" textbeforepageindexbox="转到" currentpagebuttonposition="End"
                    layouttype="Div" custominfotextalign="Right" custominfohtml="共%RecordCount%条记录。第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条"
                    direction="LeftToRight" onpagechanged="AspNetPager1_PageChanged">
                </frameworkwebcontrols:aspnetpager>  
    </div>
    <asp:Button runat="server" ID="btnRebind" style="display:none" onclick="btnRebind_Click" />
    </form>
</body>
</html>
